<!DOCTYPE html>
<html lang="en">

<head>
    <!--  Meta  -->
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>领取云算力</title>

    <!--  Styles  -->
    <link rel="stylesheet" href="styles/index.processed.css">

    <!-- 微信 JS-SDK 如果不需要兼容小程序，则无需引用此 JS 文件。 -->
    <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>

    <!-- uni 的 SDK，必须引用。 -->
    <script type="text/javascript" src="//js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.0.1.52.js"></script>
</head>

<body>
    <div id="bm">
        <div id="redeemNow" onclick="hitRedeemNow()"></div>
        <div id="redeemLater" onclick="hitRedeemLater()"></div>
    </div>

    <!-- Scripts -->
    <script src="scripts/bodymovin.js"></script>
    <script src="scripts/index.js"></script>

    <script type="text/javascript">
        window.alert = function (text) {
            //透明遮罩层
            var mask = document.createElement("div");
            mask.style.position = " fixed";
            mask.style.zIndex = 1000000;
            mask.style.top = 0;
            mask.style.bottom = 0;
            mask.style.left = 0;
            mask.style.right = 0;
            //实现alert
            var div = document.createElement("div");
            div.style.backgroundColor = "rgba(1,1,1,0.5)";
            div.style.color = " #fff";
            div.style.position = "fixed";
            div.style.zIndex = 9999999;
            div.style.height = " 35px";
            div.style.top = "100px";
            div.style.left = "50%";
            div.style.lineHeight = "35px";
            div.style.borderRadius = "4px";
            div.style.fontSize = " 16px";
            div.style.textAlign = "center";
            div.style.padding = "0 17px";
            div.className = "animated bounceInDown";
            div.id = "alert";
            div.innerHTML = text;
            document.getElementsByTagName("body")[0].appendChild(div);
            document.getElementsByTagName("body")[0].appendChild(mask);
            var selfObj = document.getElementById("alert");
            //动态调整位置
            var alertWidth = window.getComputedStyle(selfObj, null).width;
            let a = parseInt(alertWidth) / 2 + 19
            div.style.marginLeft = -a + "px";
            setTimeout(function () {
                document.getElementsByTagName("body")[0].removeChild(div);
                document.getElementsByTagName("body")[0].removeChild(mask);
            }, 2500);
        }
    </script>
</body>

</html>